import Vue from "vue";
import VueRouter from "vue-router";
import allRoutes from "./generateRoute"
import staticRoutes from "./staticRoutes"
Vue.use(VueRouter);

const routes = [
  // 自动配置路由
  ...allRoutes
  // 静态路由
  // ...staticRoutes
  // 动态路由
  //   path:'/',
  //   component:()=>import(/*webpackChunkName:'Home'*/"@/pages/Home"),
  //   children:[
  //     {
  //       path:'welcome',
  //       component:()=>import(/*webpackChunkName:'Homewelcome'*/"@/pages/Home/Welcome"),
  //     },

  //   ]
  // },
  // {
  //   path:'/login',
  //   component:()=>import(/*webpackChunkName:'login'*/"@/pages/Login")
  // }
];

const router = new VueRouter({
  routes,
});

export default router;
